<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改项目提成用户')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-projectBonusUser-edit" th:object="${projectBonusUser}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">项目：</label>
                <div class="col-sm-8">
                    <input name="projectId" th:field="*{projectId}" class="form-control" type="hidden">
                    <input name="projectName" th:field="*{projectName}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">姓名：</label>
                <div class="col-sm-8">
                    <select name="userId"  class="form-control m-b" th:field="*{userId}" th:with="type=${@customDictService.selectUserList()}" required>
                        <option value="">无</option>
                        <option th:each="dict : ${type}" th:text="${dict.userName}" th:value="${dict.userId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group" th:if="*{project.getProjectType() != 'staffing'}">
                <label class="col-sm-3 control-label is-required">比例：</label>
                <div class="col-sm-8">
                    <input name="bonusRate" th:field="*{bonusRate}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="extra" class="form-control" rows="6">[[*{extra}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "erp/projectBonusUser";
        $("#form-projectBonusUser-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-projectBonusUser-edit').serialize());
            }
        }
    </script>
</body>
</html>